home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
autose1g
/
declare.bas
< prev
next >
Wrap
BASIC Source File
|
1999-03-23
|
17KB
|
545 lines
Attribute VB_Name = "Module1"
Option Explicit
'Declare structure types: ships, players, planets
Type StarShip
Troops As Integer
AssaultTroops As Integer
'
HaveShields As Boolean
HaveShield1 As Boolean
HaveShield2 As Boolean
HaveWeapons As Boolean
HaveBigShip As Boolean
HaveCloakingDevice As Boolean
Hidden As Boolean
Sabotage As Boolean
'
CombatStrength As Integer
WarpPosition As Integer '0 if not in use, 1-8 if on warp path
Coordinate As String 'coord of originating planet
CenterX As Integer 'used to draw line from starting
CenterY As Integer 'planet to possible destinations
Launched As Boolean 'if launched, disable button to launch again
ShipNumber As Integer '0 or 1 for array of ship(2) in player structure
End Type
Type PlanetaryBody
Name As String
Owner As Integer '0,1,2 for neutral, player 1, player 2
Troops As Integer
AssaultTroops As Integer
'
HaveShields As Boolean
HaveMissiles As Boolean 'CS depends on whether player has
'missile1 or 2 researched...
HaveScanner As Boolean
HaveJammer As Boolean
InScannerRange As Boolean 'if in range of scanner - replaces sharing of "inrange" with landing
'
BioRocketETA As Integer
BioDistance As Variant
Contaminated As Boolean 'toxic to humans
NukedResources As Boolean 'resources wiped out by biorocket
InBioRange As Boolean 'if in range for biorocket
LaunchSite As Boolean 'which planet rocket firing from - used
'to erase the lines!
BioFailed As Boolean 'if enemy tried to use biorocket but it was shot down
'
CenterX As Integer
CenterY As Integer
'
ImprovedResources As Boolean
CombatStrength As Integer
Coordinate As String
Resources As Integer 'random # resources produced per turn
InRange As Boolean 'if in range for landing
BackGround As Integer '1-5 for landscape picture
Picture As Integer '1-5 for galaxy picture - used to restore after contamination
JustLanded As Boolean 'don't let ship take off after landing on a new planet
'
Sabotaged As Boolean 'in frmGameScreen, SabotageLanding, to give other player
SabotageReduction As Integer 'a message the next turn
SabotagedFactory As Boolean 'if factory destroyed in sabotage mission
Damaged As Boolean 'enables cmdRepairIndustry button
'will add 2-4 (up to 8), set to false once resources up to 4
Captured As Boolean 'for giving a message if other player took over planet on his/her turn
'
FailedInvasion As Boolean 'to notify player that opponent tried and failed to attack planet
FailedInvasionTroopLosses As Integer 'show losses suffered in defense of planet
FailedInvasionMechLosses As Integer
'
End Type
Type PlayerType
Name As String
NumTroops As Integer 'total # of troops
NumAssaultTroops As Integer
NumPlanets As Integer 'total # of planets owned
NumResources As Integer 'total of all resources
Ship(2) As StarShip
HomePlanet As Integer 'index number of home planet
WasBig As Boolean 'announce if empire shrinking
'***Research***
Missile1ResearchDone As Integer
Missile1Researched As Boolean
Missile2ResearchDone As Integer
Missile2Researched As Boolean
ShieldResearchDone As Integer 'time to research planetary shields
ShieldResearched As Boolean 'whether this tech researched
LaserResearchDone As Integer
LaserResearched As Boolean
PlasmaResearchDone As Integer
PlasmaResearched As Boolean
MechResearchDone As Integer 'time to research assault tech
MechResearched As Boolean 'whether or not player has researched this tech
BioRocketResearchDone As Integer
BioRocketResearched As Boolean
LongBioResearchDone As Integer
LongBioResearched As Boolean
ShipShield1ResearchDone As Integer
ShipShield1Researched As Boolean
ShipShield2ResearchDone As Integer
ShipShield2Researched As Boolean
BigShipResearchDone As Integer
BigShipResearched As Boolean
UltraWarpResearchDone As Integer
UltraWarpResearched As Boolean
CloakingResearchDone As Integer
CloakingResearched As Boolean
ResourceResearchDone As Integer 'time to research resource improvement
ResourcesResearched As Boolean 'whether player has researched this tech
BioCleanupResearchDone As Integer
BioCleanupResearched As Boolean
RegenerationResearchDone As Integer
RegenerationResearched As Boolean
ScannerResearchDone As Integer
ScannerResearched As Boolean
DeepScannerResearchDone As Integer
DeepScannerResearched As Boolean
JammerResearchDone As Integer
JammerResearched As Boolean
WarpScannerResearchDone As Integer
WarpScannerResearched As Boolean
'*****
Message1Given As Boolean 'warning when enemy has 10 planets
Message2Given As Boolean 'warning when enemy has 20 planets
End Type
'Declare variables of defined types
Public Player(2) As PlayerType
Public Planet(50) As PlanetaryBody
'Declare Global Variables
Public Const Modal = 1 'used to display forms as modal/nonmodal
Public Const NonModal = 0
Public gFileNum As Integer 'for reading/writing files
Public TurnNumber As Integer
'*****************************
Public Current As Integer '0 or 1, use to see whose turn it is
Public Other As Integer '0 or 1
Public Const Neutral = 2 'As Integer '2 for now...
Public Const Alien = 3 'As Integer '3 for now
'*****************************
Public ActivePlanet 'used for buying stuff
Public UnitCost '
Public Quantity '
Public PurchasePrice '
'*****************************
Public IncomingMessage As String 'for the messages players
Public OutgoingMessage As String 'send to each other
Public activeship As Integer 'either 0 or 1 for ship number
'************
'Combat:
Public AttackStrength As Integer
Public DefenceStrength As Integer
Public Losses As Integer
Public TroopLosses As Integer
Public AssaultLosses As Integer
Public NumPlanetsCaptured As Integer 'counter to see how many planets of other player taken over this turn
Public NumFailedInvasions As Integer 'counter for failed invasions by other player
'************
Public TechLevel As Integer 'for setting up techdone form
'sets which title, image and description to show
Public ReadyToLand1 As Boolean 'toggle for land1 button
Public ReadyToLand2 As Boolean
Public ScannerOn As Boolean 'toggle for mousemove, how much info shown
'in txtstatus.text for planets
Public BioRocketOn As Boolean 'toggle for biorocket launch button
Public RegenerateOn As Boolean 'toggle
Public DetoxifyOn As Boolean 'toggle
'Sound API
Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Public Sound As String
Public SoundOn As Boolean 'for sound toggle
'************************
Public GalaxySize As Integer 'for different number of planets E/M/H
'************************
Public MessageType As String 'to set picture and text for Message Form
'ie. biorocket explosion, planet overrun
Public Announceline1 As String 't